package dao.proxy;

import net.sf.cglib.proxy.Enhancer;

/**
 * @Description
 * @Author 李楚鹏
 * @Date 2024/11/29 11:59
 **/

public class IntermediaryCglibProxyFactory {
    private static IntermediaryMethodInterceptor callback=new IntermediaryMethodInterceptor();

    public static <T> T create(Class<T> target){
        Enhancer enhancer=new Enhancer();

        enhancer.setCallback(callback);
        enhancer.setSuperclass(target);
        return (T) enhancer.create();
    }
}
